<script>
	import base from '@/utils/base.ts'
	export default {
		onLaunch: function() {
			// #ifdef APP-PLUS
			const domModule = uni.requireNativePlugin('dom')
			domModule.addRule('fontFace', {
				'fontFamily': "graceuiiconfont",
				'src': "url('https://at.alicdn.com/t/c/font_823462_whtuj4ktcl.ttf?t=1703075468532')"
			});
			console.log("字体加载成功");
			// #endif

			const host = `${base.host}`
			uni.$host = host
			const token = uni.getStorageSync("token")
			if (!token) {
				uni.reLaunch({
					url: `/subpage/login/index`
				})
			}
			wx.getPrivacySetting({
				success: res => {
					console.log(res,3333) // 返回结果为: res = { needAuthorization: true/false, privacyContractName: '《xxx隐私保护指引》' }
					if (res.needAuthorization) {
						// 需要弹出隐私协议
						console.log("无效协议")
					} else {
						// 用户已经同意过隐私协议，所以不需要再弹出隐私协议，也能调用已声明过的隐私接口
						// wx.getUserProfile()
						// wx.chooseMedia()
						// wx.getClipboardData()
						// wx.startRecord()
					}
				},
				fail: () => {},
				complete: () => {}
			})
			wx.onNeedPrivacyAuthorization(function(e) {
				console.log(e);
			})
		},
		onShow: function() {},
		onHide: function() {}
	}
</script>


<!-- #ifndef APP-NVUE -->
<style lang="scss">
	/* 加载框架核心样式 */
	@import "./Grace6/css/grace.scss";
	/* 加载自定义样式 */
	@import "./custom/custom.scss";

	page {
		background: #F5F5F5;
	}
</style>
<!-- #endif -->
<!-- #ifdef APP-NVUE -->
<style lang="scss">
	/* 加载框架核心样式 */
	@import "./Grace6/css/grace.scss";
	/* 加载自定义样式 */
	@import "./custom/custom.scss";
	@import "uview-plus/index.scss";
	@import "./Grace6/css/colors.css";
	@import "./custom/font-pingfang.css";


	page {
		background: #FFF4E3;
		font-family: 'PingFang', sans-serif;
	}

	.gui-icons {
		font-family: graceuiiconfont;
		font-style: normal;
	}
</style>
<!-- #endif -->